package com.leigq.www.mybatisplusstudy.domain.entity.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*;
import lombok.experimental.FieldNameConstants;
import lombok.experimental.SuperBuilder;
import org.apache.ibatis.type.JdbcType;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * 创建使用的基类
 *
 * @author leiguoqing
 */
@EqualsAndHashCode(callSuper = true)
@Data
@FieldNameConstants(level = AccessLevel.PROTECTED, innerTypeName = "F")
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class CreateEntity extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 7295728505178702262L;


    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT, jdbcType = JdbcType.BIGINT)
    private Long createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT, jdbcType = JdbcType.DATETIMEOFFSET)
    private LocalDateTime createdTime;
}
